<?php if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('forumdisplay');?><?php include template('common/header'); $tops = DB::fetch_all("SELECT tid,fid,subject,dateline,author,authorid FROM ".DB::table('forum_thread')." WHERE `displayorder` = '3' ORDER BY `dateline` LIMIT 0,10");?><!-- header start -->
<div class="bz-header">
<div class="bz-header-left">
<a href="javascript:history.back();" class="iconfont icon-fanhui"></a>
</div>
<h2><?php echo strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];?></h2>
<div class="bz-header-right">
<a class="iconfont icon-more bzdown"></a>
<a href="forum.php?mod=guide&amp;view=hot&amp;mobile=2" class="iconfont icon-home"></a>		
</div>
</div>
<div class="bz-b-nava-ziban">
<div class="bgDiv"></div>
<div class="downNav">
<div class="downNav-cancel">
<a href="<?php if($_GET['mod'] == 'forumdisplay' || $_GET['mod'] == 'viewthread') { ?>forum.php?mod=post&action=newthread&fid=<?php echo $_G['fid'];?><?php } else { ?>forum.php?mod=misc&action=nav<?php } ?>">Post</a>
<?php if(empty($_G['forum']['picstyle'])) { ?>
    <?php } else { ?>
<a<?php if(empty($_G[ 'cookie'][ 'forumdefstyle'])) { ?> href="forum.php?mod=forumdisplay&amp;fid=<?php echo $_G['fid'];?>&amp;forumdefstyle=yes" class="chked iconfont icon-kaiguan-kai color-red" <?php } else { ?> href="forum.php?mod=forumdisplay&amp;fid=<?php echo $_G['fid'];?>&amp;forumdefstyle=no" class="unchk iconfont icon-kaiguan-guan color-b" <?php } ?> style="font-size: 12px;">&nbsp;图片模式</a>
<?php } ?>
</div>
<div style="height: 5px; background: #F6F6F6; width: 100%;"></div>
<div class="downNav-list">
<?php if($sublist > 0) { ?>
 <?php if(is_array($sublist)) foreach($sublist as $sub) { ?><a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $sub['fid'];?>"><?php echo $sub['name'];?></a>
<?php } } else { ?>
    	<div class="guide-no">
<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
<p class="color-b">子版块</p>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="banzhuan-top"></div>
<!-- header end -->

<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_top_mobile'])) echo $_G['setting']['pluginhooks']['forumdisplay_top_mobile'];?>
<?php if(CURMODULE != 'guide') { ?>
<div class="tf bz-fd-appl bz-bg-fff">
<ul>
<?php if($_GET['specialtype'] == 'reward') { } ?>
<li><a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $_G['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost<?php echo $forumdisplayadd['lastpost'];?><?php if($_GET['archiveid']) { ?>&amp;archiveid=<?php echo $_GET['archiveid'];?><?php } ?>" class="xi2<?php if($_GET['filter'] == 'lastpost') { ?> xw1<?php } ?>">Latest</a></li>
<li><a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $_G['fid'];?>&amp;filter=heat&amp;orderby=heats<?php echo $forumdisplayadd['heat'];?><?php if($_GET['archiveid']) { ?>&amp;archiveid=<?php echo $_GET['archiveid'];?><?php } ?>" class="xi2<?php if($_GET['filter'] == 'heat') { ?> xw1<?php } ?>">Hot </a></li>
<li><a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $_G['fid'];?>&amp;filter=digest&amp;digest=1<?php echo $forumdisplayadd['digest'];?><?php if($_GET['archiveid']) { ?>&amp;archiveid=<?php echo $_GET['archiveid'];?><?php } ?>" class="xi2<?php if($_GET['filter'] == 'digest') { ?> xw1<?php } ?>">精华</a></li>
<li><?php if($_G['uid']){$favfids = C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], 'fid');foreach($favfids as $val){if($val['id'] == $_G[fid]){$isFav = $val['favid'];}}}?><?php if($isFav) { ?>
<a href="home.php?mod=space&amp;do=favorite&amp;type=forum" class="forum-del iconfont icon-yiguanzhu" style="color: #D7D7D7;"></a>
<?php } else { ?>
<a id="a_favorite" href="home.php?mod=spacecp&amp;ac=favorite&amp;type=forum&amp;id=<?php echo $_G['fid'];?>&amp;handlekey=favoriteforum&amp;formhash=<?php echo FORMHASH;?>" class="forum-fav iconfont icon-guanzhu1" style="color: #FF8200;"></a>
<?php } ?>
</li>
<?php if(empty($_G['forum']['picstyle']) && $_GET['orderby'] == 'lastpost' && (!$_G['setting']['forumseparator'] || !$separatepos) && !$_GET['filter']) { } if($_GET['filter'] == 'hot') { } ?>
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_filter_extra'])) echo $_G['setting']['pluginhooks']['forumdisplay_filter_extra'];?>
</ul>
</div>
<?php } else { } ?>

<div class="banzhuan-h10"></div>

<!-- main threadlist start -->
<?php if(!$subforumonly) { ?>

    <?php if(empty($_G['forum']['picstyle'])) { ?>
<div class="banzhuan-list">
<ul>
<?php if($_G['forum_threadcount']) { if(is_array($_G['forum_threadlist'])) foreach($_G['forum_threadlist'] as $key => $thread) { $tbid = DB::result(DB::query("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE `tid`= '$thread[tid]'"));?><?php $thread[authorid]=$thread[authorid]?$thread[authorid]:0;$gr_uid = DB::result(DB::query("SELECT gr_uid FROM ".DB::table('common_member')." WHERE `uid`= '$thread[authorid]'"));?><?php $gr_uid=$gr_uid?$gr_uid:0;$gr_type = DB::result(DB::query("SELECT gr_type FROM gr_users WHERE `id`= '$gr_uid'"));?><?php $discuz_uid = $_G[uid]?$_G[uid]:'0';?><?php $discuz_gr_uid = DB::result(DB::query("SELECT gr_uid FROM ".DB::table('common_member')." WHERE `uid`=$discuz_uid"));?><?php $discuz_gr_uid = $discuz_gr_uid?$discuz_gr_uid:'0';?><?php $discuz_gr_type = DB::result(DB::query("SELECT gr_type FROM gr_users WHERE `id`=$discuz_gr_uid"));?><?php if($discuz_gr_type==4 && $gr_type==4 && $gr_uid!=$discuz_gr_uid) { continue;?><?php } if($tbid) { $picount = DB::fetch_all("SELECT aid FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1;");?><?php $picnum = count($picount);?><?php if($picnum < 3) { $litpicnum = '1';?><?php } elseif($picnum > 2 && $picnum < 6) { $litpicnum = '3';?><?php } elseif($picnum > 5) { $litpicnum = '3';?><?php } $covers = DB::fetch_all("SELECT attachment,aid,description FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1 LIMIT 0,$litpicnum;");?><?php } if(!$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0) { continue;?><?php } if($thread['displayorder'] > 0 && !$displayorder_thread) { $displayorder_thread = 1;?><?php } if($thread['moved']) { $thread[tid]=$thread[closed];?><?php } ?>

<li class="cl banzhuan-card">
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_thread_mobile'][$key])) echo $_G['setting']['pluginhooks']['forumdisplay_thread_mobile'][$key];?>
<h1>
<a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>&amp;extra=<?php echo $extra;?>" <?php echo $thread['highlight'];?>><?php echo $thread['subject'];?></a>
</h1>
<?php if($tbid) { ?>
<div class="post-bottom-three">			
<?php if($litpicnum == 1) { if(is_array($covers)) foreach($covers as $thecover) { ?><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>" title="<?php echo $thecover['aid'];?>"><img src="data/attachment/forum/<?php echo $thecover['attachment'];?>" /></a>
<?php } } ?>	
<?php if($litpicnum == 3) { if(is_array($covers)) foreach($covers as $thecover) { ?><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>" title="<?php echo $thecover['aid'];?>"><img src="data/attachment/forum/<?php echo $thecover['attachment'];?>" /></a>
<?php } } ?>		
</div>
<?php } ?>
<div class="post-bottom">
<?php if($tbid && !$picnum == 0) { ?>&nbsp;<em class="color-b iconfont icon-picfill">&nbsp;<?php echo $picnum;?>&nbsp;</em><?php } ?>
<em class="iconfont icon-attention color-b">&nbsp;<?php echo $thread['views'];?></em>
        <em class="iconfont icon-xiaoxi color-b">&nbsp;<?php echo $thread['replies'];?></em>    
    <em class="color-b"><?php echo $thread['author'];?></em>
<?php if(in_array($thread['displayorder'], array(1, 2, 3, 4))) { ?>
        <span class="iconfont icon-top01 color-zhiding"></span>
        <?php } elseif($thread['digest'] > 0) { ?>
        <span class="iconfont icon-jing color-jinghua"></span>
        <?php } elseif($thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0) { ?>
        <?php } ?>			     
  </div>
</li>
<div class="banzhuan-clear"></div>
<?php } } else { ?>
<li class="bz-p10" style="text-align: center;">
<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
<p class="color-b">本版块或指定的范围内尚无主题</p>
</li>
<?php } ?>
</ul>
</div>
<div class="banzhuan-clear"></div>
<?php echo $multipage;?>
    <?php } else { ?>
    <?php if(empty($_G['cookie']['forumdefstyle'])) { ?>
    <div class="bzwaterfall">
<ul class="cl"><?php if(is_array($_G['forum_threadlist'])) foreach($_G['forum_threadlist'] as $key => $thread) { ?><li class="bz-bg-fff">
<div class="bz-p10">
<div class="c cl">
<a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>&amp;<?php if($_GET['archiveid']) { ?>archiveid=<?php echo $_GET['archiveid'];?>&amp;<?php } ?>extra=<?php echo $extra;?>" <?php if($thread[ 'isgroup']==1 || $thread[ 'forumstick'] || CURMODULE=='guide' ) { ?> <?php } else { ?> onclick="atarget(this)" <?php } ?> title="<?php echo $thread['subject'];?>" class="z">
<?php if($thread['cover']) { ?>
<img src="<?php echo $thread['coverpath'];?>" alt="<?php echo $thread['subject'];?>"/>
<?php } else { ?>
<span class="nopic" style="width:100%; height:110px;"></span>
<?php } ?>
</a>
</div>
<div class="auth cl">
<cite class="xg1 y">
<a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>&amp;extra=<?php echo $extra;?>" title="<?php echo $thread['replies'];?> reply" class="color-b"><em class="iconfont icon-xiaoxi color-b"></em>&nbsp;<?php echo $thread['replies'];?></a>
</cite>
<?php if($thread['authorid'] && $thread['author']) { ?>
<a href="home.php?mod=space&amp;uid=<?php echo $thread['authorid'];?>" class="color-b"><?php echo $thread['author'];?></a>
<?php if(!empty($verify[$thread['authorid']])) { ?><?php echo $verify[$thread['authorid']];?>
<?php } } else { ?>
<?php echo $_G['setting']['anonymoustext'];?>
<?php } ?>
</div>
</div>
</li>
<?php } ?>
</ul>
    </div>
<div class="banzhuan-clear"></div>
<?php echo $multipage;?>
<?php } else { ?>
<div class="banzhuan-list">
<ul>
<?php if($_G['forum_threadcount']) { if(is_array($_G['forum_threadlist'])) foreach($_G['forum_threadlist'] as $key => $thread) { $tbid = DB::result(DB::query("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE `tid`= '$thread[tid]'"));?><?php if($tbid) { $picount = DB::fetch_all("SELECT aid FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1;");?><?php $picnum = count($picount);?><?php if($picnum < 3) { $litpicnum = '1';?><?php } elseif($picnum > 2 && $picnum < 6) { $litpicnum = '3';?><?php } elseif($picnum > 5) { $litpicnum = '3';?><?php } $covers = DB::fetch_all("SELECT attachment,aid,description FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1 LIMIT 0,$litpicnum;");?><?php } if(!$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0) { continue;?><?php } if($thread['displayorder'] > 0 && !$displayorder_thread) { $displayorder_thread = 1;?><?php } if($thread['moved']) { $thread[tid]=$thread[closed];?><?php } ?>

<li class="cl banzhuan-card">
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_thread_mobile'][$key])) echo $_G['setting']['pluginhooks']['forumdisplay_thread_mobile'][$key];?>
<h1>
<a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>&amp;extra=<?php echo $extra;?>" <?php echo $thread['highlight'];?>><?php echo $thread['subject'];?></a>
</h1>
<?php if($tbid) { ?>
<div class="post-bottom-three">			
<?php if($litpicnum == 1) { if(is_array($covers)) foreach($covers as $thecover) { ?><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>" title="<?php echo $thecover['aid'];?>"><img src="data/attachment/forum/<?php echo $thecover['attachment'];?>" /></a>
<?php } } ?>	
<?php if($litpicnum == 3) { if(is_array($covers)) foreach($covers as $thecover) { ?><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>" title="<?php echo $thecover['aid'];?>"><img src="data/attachment/forum/<?php echo $thecover['attachment'];?>" /></a>
<?php } } ?>		
</div>
<?php } ?>
<div class="post-bottom">
<?php if($tbid && !$picnum == 0) { ?>&nbsp;<em class="color-b iconfont icon-picfill">&nbsp;<?php echo $picnum;?>&nbsp;</em><?php } ?>
<em class="iconfont icon-attention color-b">&nbsp;<?php echo $thread['views'];?></em>
        <em class="iconfont icon-xiaoxi color-b">&nbsp;<?php echo $thread['replies'];?></em>    
    <em class="color-b"><?php echo $thread['author'];?></em>
<?php if(in_array($thread['displayorder'], array(1, 2, 3, 4))) { ?>
        <span class="iconfont icon-top01 color-zhiding"></span>
        <?php } elseif($thread['digest'] > 0) { ?>
        <span class="iconfont icon-jing color-jinghua"></span>
        <?php } elseif($thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0) { ?>
        <?php } ?>			     
  </div>
</li>
<div class="banzhuan-clear"></div>
<?php } } else { ?>
<li class="bz-p10" style="text-align: center;">
<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
<p class="color-b">本版块或指定的范围内尚无主题</p>
</li>
<?php } ?>
</ul>
</div>
<div class="banzhuan-clear"></div>
<?php echo $multipage;?>
<?php } } } ?>
<!-- main threadlist end -->

<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_bottom_mobile'])) echo $_G['setting']['pluginhooks']['forumdisplay_bottom_mobile'];?>
<div class="pullrefresh" style="display:none;"></div>

<script type="text/javascript">
$('.forum-fav').on('click', function() {
var obj = $(this);
$.ajax({
type:'POST',
url:obj.attr('href') + '&handlekey=forum-fav&inajax=1',
data:{'favoritesubmit':'true', 'formhash':'<?php echo FORMHASH;?>'},
dataType:'xml',
})
.success(function(s) {
popup.open(s.lastChild.firstChild.nodeValue);
evalscript(s.lastChild.firstChild.nodeValue);
})
.error(function() {
window.location.href = obj.attr('href');
popup.close();
});
return false;
});
</script>

<?php if(!empty($_G['setting']['pluginhooks']['global_footer_mobile'])) echo $_G['setting']['pluginhooks']['global_footer_mobile'];?><?php $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);$clienturl = ''?><?php if(strpos($useragent, 'iphone') !== false || strpos($useragent, 'ios') !== false) { $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=ios' : 'http://www.discuz.net/mobile.php?platform=ios';?><?php } elseif(strpos($useragent, 'android') !== false) { $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=android' : 'http://www.discuz.net/mobile.php?platform=android';?><?php } elseif(strpos($useragent, 'windows phone') !== false) { $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=windowsphone' : 'http://www.discuz.net/mobile.php?platform=windowsphone';?><?php } ?>
<div class="banzhuan-clear"></div>
<div id="mask" style="display:none;"></div>
<?php if(!$nofooter) { } ?>
<div class="banzhuan-bottom"></div>
</body>
</html><?php updatesession();?><?php if(defined('IN_MOBILE')) { output();?><?php } else { output_preview();?><?php } ?>